<?php
	// Массивы
	$a = array();

	$a[] = "one";
	$a[] = "two";
	$a[] = "three";

	foreach($a as $item){
		echo "$item\n";
	}
	


	$a['one'] = 1;
	$a['two'] = 2;
	$a['three'] = 3;

//	echo "$a['one']\n";
	echo "{$a['one']}\n";

	print_r($a);
	var_dump($a);

	echo "num of elements in \$a is ".count($a)."\n";

	$a = array(1,2,3);
	$b = array(4,5,6,7);
	
	$c = $a + $b;
	print_r($c);

	$c = array_merge($a,$b);
	print_r($c);

	$b = array(2 => 4, 4 => 5, 100 => 6);
	print_r($b);
	$c = $a + $b;
	print_r($c);

	foreach($a as &$item){
		++$item;
	}

	$str = serialize($c);
	echo "$str\n";
	$a = unserialize($str);

	$a = array(
		array(1,2,3),
		array(4,5,6),
		array(7,8,9));

	foreach($a as $row){
		foreach($row as $el){
			echo "$el  ";
		}
		echo "\n";
	}

	echo "\n";

	for($i = 0; $i != count($a); ++$i){
		for($j = 0; $j != count($a[$i]); ++$j)
			echo "{$a[$i][$j]}  ";
		echo "\n";
	}
	
	print_r($a);
	echo serialize($a);

?>
